<!DOCTYPE html>
<html>
<head>
  <script src="../../resources/js-test.js"></script>
</head>
<body>
  <img id="html" style="filter: url(#MyFilter);" src="resources/reference.png">
  <svg xmlns="http://www.w3.org/2000/svg" width="0" height="0" version="1.1" id="svg">
    <defs>
      <filter id="MyFilter">
        <feColorMatrix type="hueRotate" values="180"/>
      </filter>
    </defs>
  </svg>
  <script>
    description("Test that no crash occurs when a SVG filter is deleted that was referenced by a deleted HTML element.");

    html = document.getElementById('html');
    html.parentNode.removeChild(html);
    svg = document.getElementById('svg');
    svg.parentNode.removeChild(svg);

    successfullyParsed = true;
  </script>
</body>
</html>
